//
//  UIButton+extension.swift
//  微博
//
//  Created by YJW on 16/8/10.
//  Copyright © 2016年 yijiang. All rights reserved.
//

import UIKit

extension UIButton{
    
    convenience init(title:String,normalColor:UIColor,highlightedColor:UIColor,fontSize:CGFloat,backgroundImageName:String){
        
        self.init()
        
        self.setTitle(title, for: UIControlState(rawValue: 0))
        self.setTitleColor(normalColor, for: UIControlState(rawValue: 0))
        self.setTitleColor(highlightedColor, for: .highlighted)
        self.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        self.setBackgroundImage(UIImage(named:backgroundImageName), for: UIControlState(rawValue: 0))
    }
}
